//
//  WHYStatusNormalCell.swift
//  WHYWeibo-1.0
//
//  Created by 王洪运 on 15/11/28.
//  Copyright © 2015年 王洪运. All rights reserved.
//

import UIKit

class WHYStatusNormalCell: WHYStatusCell {

    override var viewModel: WHYStatusViewModel? {
        didSet {
//            QL2(viewModel?.status.user?.screen_name)
//            QL2(viewModel?.thumbnailUrls)
            
            pictureView.snp_updateConstraints { (make) -> Void in
//                判断有无配图，有->设置配图顶部的偏移量为12，没有->设置配图顶部的偏移量为0
                let offset = viewModel?.thumbnailUrls == nil ? 0 : WHYStatusCellMagrin
                make.top.equalTo(contentLabel.snp_bottom).offset(offset)
//                QL2(offset)
            }
        }
    }
    
    override func setupUI() {
        super.setupUI()
        
        pictureView.snp_makeConstraints { (make) -> Void in
            make.left.equalTo(contentView).offset(WHYStatusCellMagrin)
            make.size.equalTo(CGSize(width: 300, height: 90))
            make.top.equalTo(contentLabel.snp_bottom).offset(WHYStatusCellMagrin)
        }
    }
    

}
